" Plugins default path: ~/.local/share/nvim/site/plugin 
" Docs default path: ~/.local/share/nvim/site/doc 
""" 基础配置
:set number
:set relativenumber
:set tabstop=4
:set softtabstop=4
:set shiftwidth=4
:let g:filetype_pl = "prolog"
" +----------------------------+
" |   领航键(leader key)配置   |
" +----------------------------+
:let mapleader = ","
" 窗口管理
:nnoremap <leader>L <c-w>L
:nnoremap <leader>J <c-w>J
:nnoremap <leader>K <c-w>K
:nnoremap <leader>H <c-w>H
:nnoremap <leader>l <c-w>l
:nnoremap <leader>j <c-w>j
:nnoremap <leader>k <c-w>k
:nnoremap <leader>h <c-w>h
" +----------------------------+
" | 常规(normal)模式下的键映射 |
" +----------------------------+
" 配合 argumentative 插件实现参数列表左平移 
:nnoremap <g 0%%9<Plug>Argumentative_MoveRight0
" .... ............. ................右....
:nnoremap >g 0%9<Plug>Argumentative_MoveLeft0
" 移动映射
:nnoremap H 0
:nnoremap L $
" 向上移动 1 行
:nnoremap _ kddpk
" ..下.... 1 行
:nnoremap - ddp
" 杂项
:inoremap <esc> <nop>
:inoremap jk <esc>
" 更适合小手的圆括号击键
:inoremap LK ()<left>
" 配合 LK 食用
:inoremap JK <right>
 " 快捷代码块
:inoremap KL <esc>o{<cr><cr>}<up><tab>
:nnoremap <c-u> viwUe " 大写选中单词
:nnoremap <tab> >>
:nnoremap <s-tab> <<
:nnoremap yp yyp


""" 缩写 (abbrev)
""" autocmd - 参见 learn vimscript the hard way 第 12 章.
:augroup c_lang
:	autocmd!
:	autocmd FileType c :iabbrev <buffer> fnmain int main(int argc, char **argv) { <cr><tab>return 0;<cr>}
:augroup END

:augroup markdown_lang 
:	autocmd!
	" 参见 learn vimscript the hard way 第 15,16 章.
:	autocmd FileType markdown :onoremap <buffer> ih :<c-u>execute "normal! ?^==\\+\r:nohlsearch\rkvg_"<cr>
:augroup END
""" 欢迎仪式
:echom "Welcome to the hotdis-NeoVim configuration >^.^<"
""" 如果不知道该看什么了, 请阅读下面列出的帮助文档.
" :help internal-variables
" :help ignorecase
" :help expr4
" :help :call
" :help function-argument
" :help local-variables
" :help K
" :help :make
"""""""" 以下是(对我)完全新的内容, 好好琢磨
" :nnoremap <leader>g :execute "grep! -R" . shellescape(expand("<cWORD>")) . " .config/nvim/init.vim"<cr>
" :help quickfix-window
" :help :copen
" :help :expand
" :help cword, cnext, cprevious
" :help :silent
" :help visualmode()
" :help operatorfunc
" :help map-operator
" :help <SID>
